package com.example.gesture.Clicked

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.material.Text
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp

@Composable
fun ClickableDemo() {
    var enableState by remember {
        mutableStateOf<Boolean>(true)
    }

    var text by remember {
        mutableStateOf("Hello World")
    }
    Box(
        modifier = Modifier
            .size(200.dp)
            .clickable(enabled = enableState) {
                text = "Jetpack Compose"
            }
            .background(Color.Green),
        contentAlignment = Alignment.Center
    ) {
        Text(text = text)
    }
}